package com.csnf.service;
import com.csnf.dao.AdminDao;
import com.csnf.entity.Admin;
import java.sql.SQLException;

public class AdminService {
    AdminDao adminDao = new AdminDao();

    /**
     * 通过账号密码查询用户信息
     * @param username
     * @param pwd
     * @return
     * @throws SQLException
     */
    public Admin getAdminByNameAndPwd(String username,String pwd) throws SQLException {
        if(username.isEmpty() || pwd.isEmpty()){
            return null;
        }else{
            Admin admin = new Admin();
            admin.setAdmin_name(username);
            admin.setAdmin_password(pwd);
            return adminDao.getAdminByNamePwd(admin);
        }
    }
}
